#ifndef ZSTACK_RINGBUF_H
#define ZSTACK_RINGBUF_H

typedef unsigned int U32;
typedef unsigned char U8;

struct ringbuf
{
    U8 *buf;
    U32 size;
    U32 wr;
    U32 rd;
};

/* Return: bytes put to ringbuf */
U32 ringbuf_put(struct ringbuf *r, U8 *buf, U32 len);

/* Return: bytes get from ringbuf */
U32 ringbuf_get(struct ringbuf *r, U8 *buf, U32 len);

#endif
